﻿<fundamentals:AppBar x:Class="Daytimer.Controls.Panes.Notes.NotesAppBar"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:fundamentals="clr-namespace:Daytimer.Fundamentals;assembly=Daytimer.Fundamentals"
		xmlns:local="clr-namespace:Daytimer.Controls.Panes.Notes"
		xmlns:friction="clr-namespace:Daytimer.Controls.Friction" xmlns:controls="clr-namespace:Daytimer.Controls"
		Title="Notes App Bar" Height="{DynamicResource {x:Static SystemParameters.PrimaryScreenHeightKey}}" Width="400"
		MinWidth="275" ShowInTaskbar="False" Icon="pack://application:,,,/Daytimer.Images;component/Images/logo.ico"
		Background="#F5F5F5">
	<Window.Resources>
		<fundamentals:WindowIconConverter x:Key="WindowIconConverter" />
	</Window.Resources>
	<Grid Margin="0,-20,0,0">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition />
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition />
		</Grid.RowDefinitions>
		<Image HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None" Margin="13,0,0,0"
				IsHitTestVisible="False"
				Source="{Binding Icon, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}, Converter={StaticResource WindowIconConverter}}" />
		<TextBlock Grid.Column="1" Text="Dimension 4" Margin="10,0,0,0" HorizontalAlignment="Left"
				VerticalAlignment="Center" IsHitTestVisible="False" FontSize="14" Foreground="#808285" />
		<TextBlock Grid.Row="1" Grid.ColumnSpan="3" IsHitTestVisible="False" FontWeight="Light" Text="Quick Notes"
				FontSize="32" Margin="10,0,0,10" HorizontalAlignment="Left" VerticalAlignment="Center"
				Foreground="#808285" />
		<Border Grid.ColumnSpan="2" Grid.Row="2" Grid.RowSpan="3" BorderThickness="0,1,0,0" BorderBrush="#D0D0D0"
				Background="White" IsHitTestVisible="False" />
		<TextBox x:Name="pageTitleBox" Grid.Row="2" Margin="5,26,5,0" Padding="10,2,36,2" Grid.ColumnSpan="2"
				BorderThickness="0,0,0,1" BorderBrush="#FFE1E1E1"
				FontFamily="/Daytimer.Fonts;component/#WeblySleek UI Light" FontSize="20pt" Width="Auto"
				HorizontalAlignment="Left" TextWrapping="Wrap" MaxWidth="639" MinWidth="280" Height="NaN"
				MaxHeight="300" VerticalScrollBarVisibility="Auto"
				Text="{Binding SelectedPage.Title, RelativeSource={RelativeSource FindAncestor, AncestorType=local:NotesAppBar}}"
				Visibility="{Binding Visibility, ElementName=document}" PreviewKeyUp="pageTitleBox_PreviewKeyUp" />
		<StackPanel Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="2" Margin="17,3,0,0"
				Visibility="{Binding Visibility, ElementName=document}">
			<StackPanel.Resources>
				<local:UtcDateConverter x:Key="UtcDateConverter" />
				<local:UtcTimeConverter x:Key="UtcTimeConverter" />
				<Style TargetType="Button">
					<Setter Property="HorizontalAlignment" Value="Left" />
					<Setter Property="Width" Value="NaN" />
					<Setter Property="Height" Value="NaN" />
					<Setter Property="Background" Value="Transparent" />
					<Setter Property="Template">
						<Setter.Value>
							<ControlTemplate TargetType="Button">
								<Border x:Name="PART_Border" Background="{TemplateBinding Background}">
									<TextBlock Text="{TemplateBinding Content}" Foreground="#FF828282"
											FontFamily="Calibri" FontSize="10pt" IsHitTestVisible="False" />
								</Border>
								<ControlTemplate.Triggers>
									<Trigger Property="IsMouseOver" Value="True">
										<Setter Property="Background" Value="#FFEFEFEF" />
									</Trigger>
									<Trigger Property="IsPressed" Value="True">
										<Setter Property="Background" Value="#FFC6C6C6" />
									</Trigger>
								</ControlTemplate.Triggers>
							</ControlTemplate>
						</Setter.Value>
					</Setter>
				</Style>
			</StackPanel.Resources>
			<Button x:Name="dateCreatedDate" Click="dateCreatedDate_Click" ToolTip="Change Date"
					Content="{Binding SelectedPage.Created, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType=local:NotesAppBar}, Converter={StaticResource UtcDateConverter}}" />
			<Button x:Name="dateCreatedTime" Margin="30,0,0,0" Click="dateCreatedTime_Click" ToolTip="Change Time"
					Content="{Binding SelectedPage.Created, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType=local:NotesAppBar}, Converter={StaticResource UtcTimeConverter}}" />
		</StackPanel>
		<friction:FrictionRichTextBoxControl x:Name="document" Grid.Row="4" Grid.ColumnSpan="2" BorderThickness="0"
				Padding="12,20" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
				FontFamily="Calibri" FontSize="14.667" IsDocumentEnabled="True" Foreground="Black" AcceptsTab="True"
				IsReadOnlyCaretVisible="True" SpellCheck.IsEnabled="True" Margin="1,0,0,0" Visibility="Hidden">
			<friction:FrictionRichTextBoxControl.Resources>
				<Style TargetType="{x:Type Paragraph}">
					<Setter Property="Margin" Value="0" />
					<Setter Property="BorderBrush" Value="#FF040404" />
				</Style>
				<controls:UriToolTipConverter x:Key="UriToolTipConverter" />
				<Style TargetType="{x:Type Hyperlink}">
					<EventSetter Event="Click" Handler="Hyperlink_Click" />
					<EventSetter Event="MouseEnter" Handler="Hyperlink_MouseEnter" />
					<EventSetter Event="MouseLeave" Handler="Hyperlink_MouseLeave" />
					<Setter Property="ToolTip"
							Value="{Binding NavigateUri, RelativeSource={RelativeSource Self}, Converter={StaticResource UriToolTipConverter}}" />
				</Style>
			</friction:FrictionRichTextBoxControl.Resources>
		</friction:FrictionRichTextBoxControl>
	</Grid>
</fundamentals:AppBar>
